import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({

    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/man-hour',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/procedure/man-hour.vue'),
                    meta: { title: '工时清单' }
                },
                {
                    path: '/bom',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/product/bom.vue'),
                    meta: { title: 'bom清单' }
                },

                {
                    path: '/task',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/plan/productionPlan.vue'),
                    meta: { title: '生产任务' }
                },
                {
                    path: '/scheduling',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/plan/scheduling.vue'),
                    meta: { title: '生产调度' }
                },
                {
                    path: '/equipReport',
                    component: () => import(/*webpackChunkName: "table" */ '../components/page/equip/equipReport.vue'),
                    meta: { title: '设备台账' }
                },
                {
                    path: '/equipError',
                    component: () => import(/*webpackChunkName: "table" */ '../components/page/equip/equipRepair.vue'),
                    meta: { title: '设备故障上报' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/productList',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/product/productList.vue'),
                    meta: { title: '产品列表' }
                },
                {
                    path: '/procedure',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/procedure/procedure.vue'),
                    meta: { title: '产品工序' }
                },
                {
                    path: '/order',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/order/order.vue'),
                    meta: { title: '订单列表' }
                },
                {
                    path: '/orderException',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/order/orderException.vue'),
                    meta: { title: '异常订单' }
                },

            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
